import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router'
export const routes: RouteRecordRaw[] = [
{
  path:'/login',
  component:()=>import('@/views/login/login.vue'),
  meta:{hidden:true},
},
{
  path:'/',
  component:()=>import('@/views/laout/layout.vue'),
  meta:{hidden:true},
  children:[
    {
      path:'',
      redirect:'home'
    },
    {
      path:'article',
      component:()=>import('@/views/article/article.vue'),
      meta:{title:'内容管理',icon:'HomeFilled'}
    },
    {
      path:'home',
      component:()=>import('@/views/home/home.vue'),
      meta:{title:'数据概览',icon:'HomeFilled'}
    },
    {
      path:'publish/:id?',
      component:()=>import('@/views/publish/publish.vue'),
      meta:{title:'发布文章',icon:'HomeFilled'}
    }, 
    {
      path:'profile',
      component:()=>import('@/views/profile/profile.vue'),
      meta:{title:'个人中心',icon:'HomeFilled'}
    },
  ]
}
]
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  scrollBehavior: () => ({ top: 0 }),
  routes,
})
export default router